USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_ESTADO_TRABAJADOR]    Script Date: 11/24/2011 14:32:44 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WASP_M0002_ESTADO_TRABAJADOR]') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].[WASP_M0002_ESTADO_TRABAJADOR]
GO

USE [BMIG_Mensual_POST_CADENA]
GO

/****** Object:  StoredProcedure [dbo].[WASP_M0002_ESTADO_TRABAJADOR]    Script Date: 11/24/2011 14:32:44 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[WASP_M0002_ESTADO_TRABAJADOR]
AS
BEGIN
	SELECT	z07325cta as cta, 
			est = 
			CASE z07304cod
				WHEN 1 THEN 0
				ELSE 9
			END 
	INTO	est_trabajador
	FROM	z07325 (NOLOCK)
END

GO


